home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
NEWSOFT
/
JUNE
/
ASM
/
ASMTxt
< prev
next >
Wrap
Text File
|
1996-12-27
|
32KB
|
812 lines
INTRODUCTION
~~~~~~~~~~~~
ASM is a (mostly) full function assembler for the Archimedes and A3000 machines,
producing an AOF (Acorn Object Format) file suitable for use with the linker.
To install ASM, simply move the file "ASM" into your Library directory.
To assemble a file, use the command:
ASM [options] <sourcefile>
where <sourcefile> is the name of the file to be assembled. If no directory is specified,
ASM will look for the source file in sub-directory A. For compatibility with C, the filename
"SOURCE.A" is taken to refer to "A.SOURCE". The output will have the same leaf name as the
sourcefile, and be stored in sub-directory O.
Options are used to modify the standard behaviour of the assembler, and are introduced by
a hyphen, the option name, and any allowed parameters. So long as enough letters of the option
name are given to preclude ambiguity, any number of letters may be given; all options are case-
insensitive. In the list of options below, the upper case part of the name indicates the minimum
that can be specified to preclude ambiguity.
Option Effect
-Output <filename> The assembled code is written to <filename> rather than the
default. If no directory is given, subdirectory O is assumed.
-List [<filename>] An assembler listing is produced. If no filename is given, the
file is given the same name as the sourcefile. By default, the
file is produced in subdirectory L.
-Hex Include the generated hex code in the -List file. If -List is
not explicitly specified, this option implies it.
-Include <pathlist> Specifies a search path for use in the 'INCLUDE' directive (qv).
<pathlist> is a comma-separated list of directories (or RISCOS
symbols) to be searched for the file.
This is a slight deviation from the method use by the C compiler,
which allows the -I option (which serves the same purpose) to be
specified several times, each of which extended the search list.
ASM only allows a single use of -Include, where all the paths are
specified at once.
-VErbose Output informational messages describing the current phase of assembly.
-VAlidate The List file produced contains a disassembly of the generated code
rather than the source code. It is not anticipated that users will
make much use of this. As for -Hex, -VAlidate implies -List.
-Flags <flaglist> Defines a number of flags to be set before beginning the assembly, for
use in the IFDEF/IFNDEF directives. <flaglist> is a comma-separated
list of flag names. Note that these flags are NOT assembler symbols,
and cannot be used as such - they are only recognized by IFDEF and
IFNDEF.
-Nocase Forces ASM to use case-insensitive name matching for user-defined
symbols.
-Throwback Enables the Acorn desktop throwback error-reporting mechanism.
-Processor <CPU> Specifies the target processor. This constrains which of the extended
instruction set operations are available. Legal values for <CPU> are:
ARM2, ARM3, ARM6 and ARM7.
(StrongARM will be coming when I discover what additional opcodes, if
any, are available).
-Help Produce brief help text for the ASM syntax and options.
Examples
ASM tharg
will assemble the code in A.tharg and produce an object file O.tharg
ASM -hex -flags debug,check -include <C$UserLibRoot>,<ASM$MylibRoot> eric
will assemble the file A.eric and produce an object file O.eric; a listing file called
L.eric will be produced containing the hex code generated. Any 'INCLUDE' statements will
look in directories <C$UserLibRoot> and <ASM$MylibRoot> for the include files. Finally,
the conditional assembly flags debug and check will be treated as set.
SOURCE FORMAT
~~~~~~~~~~~~~
It is assumed that the user is fully familiar with ARM assembly language (what are you
doing with ASM if you aren't?) and therefore this note contains no tutorial-type introduction;
only the differences between the ASM format and that in use in the BASIC assembler are detailed.
It is recommended that users of ASM be familiar with the "RISCOS Programmer's Reference
Manual" (especially those sections on the linker and Acorn Procedure Calling Standard) and Peter
Cockerell's "ARM Assembly Language Programming".
Throughout, mnemonics and their options follow the de facto standard, that in Cockerell's
book. For certain FP coprocessor instructions this differs slightly from that used by the
disassembler (SWI "Debugger_Disassemble"), which seems to contain a bug anyway.
The general format of a line is:
[<label-part>] [<mnemonic-part>] [<comment-part>]
Any or all of these parts are optional. Unlike the BASIC assembler, there is no facility
to put multiple mnemonics on a single line by separating them with a colon.
<label-part> A label is any legal ASM Symbol (see below), terminated by a colon.
<mnemonic-part> This part is any ARM instruction mnemonic (eg ADDS, STMFD), generic coprocessor
mnemonic (eg MCR, CDPEQ), or any Floating Point coprocessor mnemonic (eg MUFD,
FIXS), plus any associated parameters.
Alternatively, this could be the ADR pseudo-operation, or any ASM directive
(eg IFDEF, MACRO).
<comment-part> A comment is introduced by a semi-colon. Any text following a semi-colon on a
line is ignored.
In addition to the above format, ASM will also accept constant definitions of the form:
<label> = <constant-expression>
and <label> = <register-expression>
where <label> is a legal ASM identifier (without the colon this time), <constant-expression>
evaluates to an integer, and <register-expression> is one of the built-in register symbols
(see “Symbols in ASM” below).
The following code fragment demonstrates both possible formats (it actually performs a 64-bit
integer addition):
result = 0
lhs = result + 1
rhs = lhs + 2
EXPORT Long_Add ; Make the function external
Long_Add: STMFD sp!,{lhs ,lhs+1,link}
ADDS lhs,lhs,rhs
ADCS lhs+1,lhs+1,rhs+1
BVS overflow
STMIA result,{lhs ,lhs+1}
LDMFD sp!,{lhs ,lhs+1,pc}^
overflow: ADR R0,oflerr
SWI "OS_GenerateError"
oflerr: DCD &901
DCS "Arithmetic overflow"
DCB 0
ALIGN
etc
Symbols in ASM
~~~~~~~~~~~~~~
Symbols (Identifier names) in ASM may contain the following characters: A-Z, a-z, 0-9,
underscore (_) and dollar ($). These may be in any order, with the exception that an identifier
cannot begin with a digit.
There are several classes of identifiers in ASM :
Constants Constants are defined by the use of the <constant> = <expression> format. The
expression must evaluate to an integer, and may contain other constants. For
example, the symbol "result" in the example above is a constant.
Local Symbols A local symbol is a label. The symbols "overflow" and "oflerr" in the example
above are local symbols. Local symbols may be either "Close" or "Far": see below.
Global Symbols A global symbol is similar to a local symbol, but one that has been made
externally visible at the link stage by the use of the EXPORT directive. Global
Symbols may be "Close" or "Far".
Externals An external symbol is similar to a label, but is not defined within this assembly
unit. It is introduced by the IMPORT directive. References to External symbols
must be resolved by the linker. External Symbols are always "Far".
User-defined symbols are case-sensitive (ie "SYMBOL" is not the same as "symbol") unless the
-nocase qualifier has been specified on the command line.
In addition to the above user-defined symbols, ASM provides a set of built-in symbols of special
types, which are case-insensitive. These symbols refer specifically to registers, either in the
ARM itself or in the FP coprocessor.
These built-in symbols are:
r0-r15 ARM registers 0 to 15.
sp Stack Pointer. Set to R13.
link Link register (R14).
pc Program Counter/Status register (R15).
f0-f7 FP Coprocessor register 0 to 7.
a1-a4 )
v1-v6 )
ip ) These are defined as part of the Acorn Procedure Calling Standard.
fp ) ASM binds them to their RISCOS values (APCS-R).
sp )
lr )
pc )
ASM tries to be as flexible as possible with its parsing: where a mnemonic requires an
ARM register name, ASM will accept any of the register constants above (except the FP register
f0-f7) OR an integer expression which evaluates to a number in the range 0-15. Where a FP
coprocessor register is required, ASM will accept the register symbols f0-f7, or an integer
expression which evaluates to a number in the range 0-7. However, if a constant is required, ASM
will reject the use of any of the register symbols.
Areas
~~~~~
When the linker is combining several AOF files, it does so on the basis of "Areas". An
area is a named chunk of contiguous memory with associated attributes (eg area contains code,
area contains data, area is readonly etc) (See the AREA directive). ASM allows multiple areas to
be created in a single source file, but the ordering of areas in the final executable image is
wholly the responsibility of the linker. This leads to the concept of Close and Far symbols.
Close and Far Symbols
~~~~~~~~~~~~~~~~~~~~~
While some ARM mnemonics allow access to the entire 26-bit address space (eg BL A_Sub)
others allow only a restricted window into the address space (eg PC-relative addressing,
such as LDR R0,Tharg). Where the entire address space is legal, ASM will accept either a
symbol which is close to the the instruction or one that is far away. Where only a
restricted address space is available, ASM will accept only a close symbol.
ASM regards a symbol as "Close" if and only if it is a local or global symbol, AND ITS
DEFINING POINT IS IN THE SAME AREA AS THE INSTRUCTION THAT REFERENCES IT. All other
symbols are "Far".
For example :
AREA ASM$$CodeA,Code
Y: etc
AREA ASM$$CodeB,Code,ReadOnly
etc
BL X ; Legal.
BL Y ; Legal. Y is Far, but allowed.
ADR R0,X ; Legal. X is Close
LDR R0,Y ; Illegal. Y is Far & address space not available
etc
X: MOV r0,r1
etc
The user need not particularly worry about close and far symbols; ASM handles this
automatically. It is included in this documentation simply to explain the cause of the error
"Local Symbol Expected" that the above code fragment will generate, despite the fact the the
symbol 'Y' is defined locally.
Other Exotica
~~~~~~~~~~~~~
Where a PC-relative address is allowed, ASM supports an additional syntax, as in:
B *+12
or LDR R4,*+8
In this notation, the asterisk * means "the address of the current instruction" (Not the
PC - allowing for pipelining, the PC will be at *+8). ASM resolves this as a PC-relative address.
Its use is not particularly recommended, as local code changes may require that the offset be
manually changed (whereas labels are self-adjusting). However, for short jumps it does negate the
need for a label, which is why it is provided.
STRINGS, CHARACTER CONSTANTS AND NUMERICS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ASM differentiates strongly between strings and character constants. A string is enclosed
in double quotation marks ("), and can be of any length. A character constant is enclosed in
single quotation marks (') and its maximum length depends on the current context:
MOV R0,'A' ; Move ASCII 'A' (65) into R0
MOV R0,"A" ; Will generate an assembly error.
DCW 'AB'
The last statement above will store two bytes, ASCII A followed by ASCII B.
ASM, like C, uses the backslash (\) as an escape character to store odd values in
strings:
\n Newline
\r Carriage Return
\t Tab
\' Single Quote
\" Double Quote
\\ Backslash
\xhh Hex code hh. eg \x0E is ASCII 14 (<CTRL>N).
Integers may be specified in a number of ways: & treats the characters following as a
hexadecimal number, % treats it as binary, no character treats it as base 10.
ADD R0,R0,#&F0 ; Add F0 Hexadecimal (240 decimal) to R0
SUB R1,R1,#%1100 ; Subtract 1100 binary (12 decimal) from R1
MOV R2,#15 ; Move 15 decimal into R2
Floating point numbers may only be specified in base 10. They may include both decimal
points and exponents. However, there must be at least one digit before either the decimal point
or the exponent.
ADFD f0,f0,#3.0 ; Add 3.0 to f0.
DCFD 1.0654E-6 ; Store a double-precision constant.
DCFE .3421 ; Illegal - no digit before the decimal point.
It should be remembered that there are only 8 floating point values that can be used as
immediate value constants: these are 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 0.5 and 10.0.
Arithmetic Expressions
~~~~~~~~~~~~~~~~~~~~~~
Wherever an integer or floating point number is required, ASM will accept an expression
that evaluates to the correct type (ie integer expressions must not contain any floating point
values). ASM recognizes the following operators:
Operator Precedence
Unary + 1
Unary - 1
* 2
/ 2
% (remainder) 2
& (bitwise AND) 2
+ 3
- 3
| (bitwise OR) 3
^ (bitwise Exclusive OR) 3
>> (Arithmetic shift right) 4
>>> (Logical shift right) 4
<< (Logical shift left) 4
Sub-expressions in parentheses are allowed, and have the highest priority. They may be
nested to an arbitrary degree.
Within a single level of priority, expressions are evaluated left to right.
There are a number of constraints on the use of certain operators:
1) Only + and - operators that can be applied to non-constant symbols (ie addresses).
Thus
BL Tharg+2*4
is legal, but
BL Tharg*2
is not.
2) Bit-based operators (&, |, ^, >>, >>> and <<) may only be used in integer constant
expressions or sub-expressions.
Thus
DCFE 12345.6 + (1<<12)
is legal, but
DCFD 12345.6 >> 2
is not.
Rule 1 is to ensure that addresses are always properly relocatable. Rule 2 is because it is not
very meaningful to apply bit operators to floating point values.
MACROS
~~~~~~
A Macro is a section of code defined in a single place, and then used in several places.
It differs from a Branch-with-link in that the macro is copied in whole wherever it is used; it
thus generates more code than a branch-with-link, but will usually process faster; in addition,
it does not make any use of the stack.
Macros may be given any number of parameters, of any type (including labels - see below).
These are automatically substituted when the macro instruction is used. The handling of labels
within macros is quite straightforward: if the defining point of the label is within the limits
of the macro, it is regarded as a local label, and substituted; any labels referenced that are
not within the bounds of the array are not substituted. Local label names generated by ASM are of
the form $nnnnnn, where nnnnnn is 300000 plus a count of the number of labels generated. Thus,
the first label will be called $300001, the second $300002, etc. For obvious reasons, labels of
this form should be avoided by the user.
A macro is defined with the MACRO directive, and terminated with the ENDM directive.
A macro is used simply by giving its name as a standard mnemonic, followed by a list of
its parameters.
As an example, consider a macro to take the absolute value of 64-bit integer held in two
consecutive registers. This will be defined as ABS64, and then used twice, once for register pair
R0,R1 and once for register pair R2,R3.
MACRO ABS64,regno
CMP regno+1,#0 ; Is the upper word negative?
BPL notneg
; It is negative. Subtract it from zero to get the abs value
RSBS regno,regno,#0
RSC regno+1,regno+1,#0
notneg: ENDM
; Now use the macro
ABS64 R0 ; Ensure R0,R1 is positive
ABS64 R2 ; Ensure R2,R3 is positive
etc
When expanded, this will be assembled as:
; ABS64 R0
CMP R0+1,#0 ; Is the upper word negative?
BPL $300001
; It is negative. Subtract it from zero to get the abs value
RSBS R0,R0,#0
RSC R0+1,R0+1,#0
$300001:
; ABS64 R2
CMP R2+1,#0 ; Is the upper word negative?
BPL $300002
; It is negative. Subtract it from zero to get the abs value
RSBS R2,R2,#0
RSC R2+1,R2+1,#0
$300002:
NB The use of the INCLUDE directive is specifically forbidden within a macro definition. It is
legal for the body of one macro to use another macro; however, it is illegal to nest the actual
definitions.
Labels as macro parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~
As stated above, it is perfectly legal to pass a label into a macro. For example:
MACRO JMPZ,regno,a_label
CMP regno,#0
BEQ a_label
ENDM
JMPZ R0,tharg
etc
tharg: do something
CONDITIONAL ASSEMBLY
~~~~~~~~~~~~~~~~~~~~
ASM gives simple support to conditional assembly: ie, the code produced can be made to
depend on the value of some flags defined by the assembly command.
The directives involved in conditional assembly are IFDEF (a specified flag is defined),
IFNDEF (a specified flag is not defined), ELSE and ENDIF.
As described above, the flags used by IFDEF/IFNDEF are set using the -flags assembly
options. Any flags not explicitly set are treated as unset.
For example:
IFDEF Debug
STMFD sp!,{r0 }
ADR R0,DebugMsg
SWI "OS_Write0"
B EndDBug
DebugMsg: DCD &902
DCS "Hello there"
DCB 0
ALIGN
EndDBug:
ENDIF
If the file was assembled using -flags debug, the code between the IFDEF and the ENDIF
will be included in the output AOF file; otherwise it will not.
IFNDEF works in exactly the same way, except the code is included if the specified flag
is not set.
ELSE works in the expected way.
Any number of IFDEF/IFNDEFs may be nested, they may be nested inside MACRO definitions,
and vice versa.
NEW FEATURES
~~~~~~~~~~~~
Version 3 has a number of new features:
a) Throwback
ASM now fully supports Acorn’s desktop throwback error-reporting mechanism. It is
activated by the use of the ‘throwback’ qualifier on the command line.
b) Case-insensitive symbol names
User-defined symbols can now be (optionally) be made case-insensitive. This feature is
activated by the ‘nocase’ qualifier on the command line.
c) Extended ARM instruction set
The additional instructions introduced by the ARM3, ARM6 and ARM7 series processors are
now supported. ASM must be informed of the architecture for which the code is targetted,
using the ‘processor <proc>’ qualifier. If this qualifier is not present, ASM assumes an
ARM3 target. The use of an opcode that is not available on the specified target processor
will generate an error. The extra instructions available are:
Mnemonic Earliest Description
Target
SWP ARM3 Single data swap
MRS ARM6 Processor Status Register transfer (Register->PSR)
MSR Processor Status Register transfer (PSR->Register)
UMULL ARM7 Unsigned 64-bit multiply
SMULL Signed 64-bit multiply
UMLAL Unsigned 64-bit multiply with accumulate
SMLAL Signed 64-bit multiply with accumulate
NB. The 64-bit multiply instructions only work in 32-bit modes, while RISCOS works in
26-bit mode, which makes its use in ASM somewhat moot.
WARNING
~~~~~~~
ASM uses the Debugger_Disassemble SWI to decode the generated opcodes for the ‘validate’ option.
Sadly, this SWI does not seem to recognise the SWP instruction, and they are all returned as
“Undefined Instruction”. Users should ignore these errors, as ASM has been tested fairly
extensively in this area, and the generated codes match with the Acorn documentation. Should you
be able to shed any definitive light on this situation (ie whether the SWI or the documentation
is at fault), please contact the author.
DIRECTIVES
~~~~~~~~~~
The rest of this documentation concentrates on the assembler directives provided by ASM.
=================================================================================================
ALIGN Ensures that the code pointer is on a word boundary.
Format: ALIGN
Certain DC directives (DCB, DCW, DCS) store a number of bytes that is not an exact multiple of
four. RESB may also reserve less than a complete number of words. It is therefore possible for a
label to be given an address which is not that which is required. The use of ALIGN will bump the
pointer forward to ensure that it is correctly word-aligned.
NB All mnemonics and all other DC operations automatically carry out an align, and labels are
adjusted to allow for this. Thus the two code fragments below lead to different values for L1 and
L2 (L1 is NOT word-aligned, but L2 is aligned).
1) DCB 0
L1:
B Tharg
2) DCB 0
L2: B Tharg
If code fragment 1 had an ALIGN directive after the DCB, L1 and L2 would have the same value.
eg ALIGN
See Also: DC, RESB
=================================================================================================
AREA Instructs ASM to start a new area.
Format: AREA <areaname>,<attributes>
The areaname parameter is any legal ASM identifier. The attributes parameter(s) must specify one
of CODE or DATA. READONLY may be specified.
eg AREA ASM$$Code,Code,ReadOnly
Note that an AREA statement must precede any mnemonics or directives that cause data to be
written to the area.
Later versions of ASM may support additional AOF area types (eg Zero-Initialized, Common Block,
Common Block Reference).
See Also:
=================================================================================================
DC Store a constant value.
Format: DC<type> <value>[,<value>....]
The <type> is one or two characters that define the type of the constant being stored, and hence
the type expected of <value>
<type> Type of Value
B Byte
W Word. Actually this is a 16-bit value (ie a half-word). This letter is used for
consistency with the BASIC assembler and AASM.
D Double Word. Actually a 32-bit value. See above.
Q Quad Word. A 64-bit integer value.
S String. (NB C programmers: this is NOT zero-terminated - use DCSZ below).
SZ Zero-terminated string.
FS Single-precision floating point
FD Double-precision floating point
FE Extended-precision floating point
FP Packed floating point.
eg DCB &FF
DCS "Hello there"
DCSZ “Hello again”
DCFE 12.32E12, 3.141592
The use of DCD allows addresses to be stored, and hence the address of Far symbols to be loaded
into registers:
IMPORT myaddress
etc
LDR R1,addr
etc
addr: DCD myaddress
Where a DCD is used that is interpreted as an address, ASM will automatically generate any
required relocations.
See Also: EQU, RESB
=================================================================================================
ELSE Part of IF/ELSE/ENDIF conditional assembly structure.
Format: ELSE
ELSE negates the current condition flag. See the section on Conditional Assembly for details of
the use of IFDEF/IFNDEF/ELSE/ENDIF.
eg ELSE
See Also: IFDEF, IFNDEF, ENDIF
=================================================================================================
ENDIF Part of IF/ELSE/ENDIF conditional assembly structure.
Format: ENDIF
ENDIF terminates the current conditional assembly statement. See the section on Conditional
Assembly for details of the use of IFDEF/IFNDEF/ELSE/ENDIF.
eg ENDIF
See Also: IFDEF, IFNDEF, ELSE
=================================================================================================
ENDM Part of a MACRO/ENDM macro definition structure.
Format: ENDM
ENDM terminates the current macro definition. See the section on Macros for details of the use
of MACRO/ENDM.
eg ENDM
See Also: MACRO
=================================================================================================
ENTRY Define the entry address for a program.
Format: ENTRY <symbol>
The linker requires that one and only one of the object files given to it contain an entry
address; this is the location that will be called when the linked program is run. The ENTRY
directive specifies a (Local or Global) symbol which will be used for the entry point.
eg ENTRY Start
Note, however, that there is an extensive quantity of code required to set up application memory
constraints etc, during program initialization, which is outside the scope of this documentation;
for this reason, the author does not advocate the use of the ENTRY directive unless you know
exactly what you are doing; it is much easier to use C for the majority of an application, and
just program the time-critical parts in ASM.
See Also:
=================================================================================================
EQU Store a constant value.
Format: EQU<type> <value>[,<value>....]
EQU is a synonym for DC, and works in exactly the same way. It is supported simply for
consistency with the BASIC assembler.
eg EQUB 12
See Also: DC, RESB
=================================================================================================
EXPORT Gives a local symbol global scope.
Format: EXPORT <label>
By default, all labels used in an ASM source file are local, and hence other source files cannot
call locally-defined routines. The EXPORT directive gives the linker visibility over the
specified label.
Note that the EXPORT directive and the defining point of the label may appear in either order -
ASM will accept both.
eg EXPORT ADD_64
See Also: IMPORT
=================================================================================================
IFDEF Part of IF/ELSE/ENDIF conditional assembly structure.
Format: IFDEF <flag>
The flag parameter is any legal ASM identifier. Note that although it follows the same naming
conventions, such a flag cannot be used in any expression evaluation, for example as an integer.
See the section on Conditional Assembly for details of the use of IFDEF/IFNDEF/ELSE/ENDIF.
eg IFDEF Debug
See Also: IFNDEF, ELSE, ENDIF
=================================================================================================
IFNDEF Part of IF/ELSE/ENDIF conditional assembly structure.
Format: IFNDEF <flag>
IFNDEF acts exactly as an IFDEF, but with the condition negated. See the section on Conditional
Assembly for details of the use of IFDEF/IFNDEF/ELSE/ENDIF.
eg IFNDEF Verbose
See Also: IFDEF, ELSE, ENDIF
=================================================================================================
IMPORT Declares the name of a symbol defined in a separate module.
Format: IMPORT <symbol>
IMPORT informs ASM that the specified symbol needs to be visible to the current module (ie the
name is referenced somewhere in the current source file). The symbol can then be used as a (Far)
address, and any references to it will be handled by the linker. The IMPORT directive may be
placed before or after the symbol is first used (although it is normal to declare the symbol
before it is used).
eg IMPORT ErrorHandler
B ErrorHandler
See Also: EXPORT
=================================================================================================
INCLUDE Directs ASM to include another file in the current module.
Format: INCLUDE <filename>
The INCLUDE directive causes ASM to begin reading source text from the specified file. When that
file is exhausted, ASM will continue with the calling file.
The <filename> parameter must be specified as a quoted string. If no directory specification
exists, ASM will look in subdirectory 'I' for the file. For compatibility with C, ASM will accept
a filename of the form "FRED.I" as meaning "I.FRED".
The -Include option on the ASM command allows the specification of a path list for the given file;
if the file is not found locally, then each path will be checked in order. Only if the file is not
found on any path will ASM report an error.
NB The use of INCLUDE is forbidden in a macro definition.
eg INCLUDE "UtilityHdr.I"
See Also:
=================================================================================================
MACRO Part of MACRO/ENDM macro definition structure.
Format: MACRO <macroname>[,<parameterlist>]
MACRO begins the definition of a new macro. <macroname> can be any legal ASM identifier.
<parameterlist> is a comma-separated list of formal parameter names, which will be substituted
when the macro is instantiated. The actual parameters may be of any type (string, integer, float
etc). See the section on Macros for details of the use of MACRO/ENDM.
eg MACRO ERROR,errnum,errtext
A Macro is instantiated by using its name as if it were a mnemonic, and passing values for the
formal parameters.
eg ERROR &901,"This is an error"
See Also: ENDM
=================================================================================================
RESB Reserve a (zero-initialized) block of memory.
Format: RESB <length>
The RESB directive instructs ASM to increment the code pointer by the specified length; the
block of memory so reserved will be filled with zeros. Note that <length> is specified in bytes,
and hence the code pointer may not be word-aligned after executing the RESB operation.
RESB is generally used where a large buffer is required, to save the use of many DC directives.
eg RESB 128
See Also: DC, EQU